/*
 * Rotation.h
 * Created on: 04/04/2011
 * Author: Catharine Quintans Bezerra
 */

#include "highgui.h"
#include "cv.h"
#include "cxcore.h"
#include "cvaux.h"

#ifndef ROTATION_H_
#define ROTATION_H_

using namespace cv;

class Rotation {
public:
	Rotation();
	virtual ~Rotation();
	static void rotate(IplImage * src, IplImage * dst, int threshold);

private:
	static void rotateImage(IplImage * src, IplImage * dst, double angle, double valueCvScalarAll);
	static void printTable(IplImage * src, IplImage* dst);

	static int findFirstColumn(IplImage * img);
	static int findYPoint(IplImage * img, int x);
	static int findLastColumn(IplImage * img, int threshold);
	static int findLastLine(IplImage* img, int threshold);
	static int findXPoint(IplImage* img, int y);
	static int findFirstLine(IplImage * img);

	static double findAngle(int xPoint1, int yPoint1, int xPoint2, int yPoint2);
};

#endif /* ROTATION_H_ */
